package com.qin.sort;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * @author chenkq
 * @version 1.0
 * @date 2020/10/13
 * 冒泡排序算法
 */
public class BubbleSort {
    public static void main(String[] args) {
        List<Integer> listNum = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()){
            listNum.add(scanner.nextInt());
        }
        Integer[] array = listNum.toArray(new Integer[]{});
        for (int i = 0; i < array.length-1; i++) {
            for (int j = 0; j < array.length-i-1; j++) {
                if(array[j] > array[j+1]) {
                    array[j] = array[j] ^ array[j+1];
                    array[j+1] = array[j] ^ array[j+1];
                    array[j] = array[j] ^ array[j+1];
                }
            }
        }
        System.out.println(Arrays.toString(array));
    }
}
